<template>
    <div>
<h1>会员权益显示</h1>
    </div>
    
<table class="table table-bordered" border="1">
    <thead>
    <tr style="background-color: aqua;">
        <td>权益编号</td>
        <td>权益名称</td>
        <td>权益说明</td>
        <td>是否自定义</td>
        <td>规则类型</td>
        <td>操作</td>
    </tr>
</thead>
<tbody>
    <tr v-for="item in xs">
        <td>{{ item.mr_id }}</td>
        <td>{{ item.mr_name }}</td>
        <td>{{ item.mr_zdy==true?'是':'否' }}</td>
        <td>{{ item.mr_meiju==0?"折扣":item.mr_meiju==1?"餐饮":"延时" }}</td>
        <td>{{ item.mr_Rule }}</td>
        <td>  操作     </td>
  
    </tr>
</tbody>
</table>

当期第{{fy.index}}页,共{{fy.pagecount}}页，共{{ fy. totacount}}行
</template>

<script setup lang="ts">
import {ref,onMounted  } from "vue";
import axios
 from "axios";


 const xs =ref([{


    mr_id: 0,
  mr_name: "",
  mr_sm: "",
  mr_zdy: true,
  mr_meiju: 0,
  mr_Rule: ""


 }])


 const  fy=ref({

index:1,
szie:2,
totacount:0,
pagecount:0


})

 onMounted(()=>{

    pb();

 })


 const pb=()=>{
    axios.get('https://localhost:7268/api/hy/showhyqyi',{

        params:{
            pageindex:fy.value.index,
            pagesize:fy.value.szie
        }
       
    })
    .then(res=>{

        console.log(res.data)
        xs.value=res.data.pagedate
 
        fy.value.totacount=res.data.totalcount;
        
        fy.value.pagecount=res.data.pagecount;

    })
    .catch(error=>{

        console.log(error);
    })
 }
 
 

 
</script>

<style scoped>

</style>